package com.ghy.ic.mo.common;

import com.jfinal.kit.PropKit;
import com.jfinal.qyweixin.sdk.api.SendMessageApi;
import com.jfinal.qyweixin.sdk.msg.send.QiYeTextMsg;
import com.jfinal.qyweixin.sdk.msg.send.Text;

/**
 * @author Y-Tree
 * @date 18-12-1 下午10:52
 */
public class SendTextMsgCommon {
	
	/**
	 * 发送普通文本消息
	 * @param userId 用户id
	 * @param msg 消息体
	 */
	public static void sendTextMsg(String userId, String msg){
		
		QiYeTextMsg textMsg = new QiYeTextMsg();
		textMsg.setAgentid(PropKit.get("agentId"));
		textMsg.setText(new Text(msg));
		textMsg.setTouser(userId);
		textMsg.setSafe("0");
		SendMessageApi.sendTextMsg(textMsg);
	}

}
